/**
 * Copyright 2011 Adrian Witas
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.abstractmeta.commandify.command;


/**
 * Represent a command in the command pattern.
 * A command is used to represent an action/invocation on an instance.
 * An action encapsulation has been broken down for the following to be able
 * reply/restore a state of given instance or just to apply relevant changes locally
 * or remotely.
 * <ul>
 *     <li>{@link FieldCommand} represents a field mutator call</li>
 *     <li>{@link MethodCommand} represents a method call</li>
 *     <li>{@link ConstructorCommand} represents a constructor call</li>
 * </ul>
 *
 * @author Adrian Witas
 */
public interface Command<T>  {

    Object getSource();

    void execute(T instance);


}
